/**
 * 菜单配置
 */
import { ReactNode } from 'react';
import { BugOutlined } from '@ant-design/icons';
import React from 'react';

/**
 * 菜单项接口
 */
export interface MenuItem {
  key: string;
  label: string;
  icon?: ReactNode;
  path: string;
  children?: MenuItem[];
  permissions?: string[];
  roles?: string[];
  hidden?: boolean;
}

/**
 * 侧边栏菜单
 */
export const SIDEBAR_MENU: MenuItem[] = [
  {
    key: 'dashboard',
    label: '仪表盘',
    icon: null,
    path: '/dashboard',
  },
  {
    key: 'user',
    label: '用户管理',
    icon: null,
    path: '/user',
    children: [
      {
        key: 'user-list',
        label: '用户列表',
        path: '/user/list',
      },
      {
        key: 'user-group',
        label: '用户组',
        path: '/user/group',
      },
    ],
  },
  {
    key: 'system',
    label: '系统管理',
    icon: null,
    path: '/system',
    children: [
      {
        key: 'role',
        label: '角色管理',
        path: '/system/role',
      },
      {
        key: 'permission',
        label: '权限管理',
        path: '/system/permission',
      },
      {
        key: 'dict',
        label: '字典管理',
        path: '/system/dict',
      },
      {
        key: 'log',
        label: '系统日志',
        path: '/system/log',
      },
      {
        key: 'bug',
        label: 'Bug反馈',
        icon: React.createElement(BugOutlined),
        path: '/system/bug',
      },
    ],
  },
  {
    key: 'organization',
    label: '组织管理',
    icon: null,
    path: '/organization',
    children: [
      {
        key: 'department',
        label: '部门管理',
        path: '/organization/department',
      },
      {
        key: 'position',
        label: '岗位管理',
        path: '/organization/position',
      },
    ],
  },
  {
    key: 'content',
    label: '内容管理',
    icon: null,
    path: '/content',
    children: [
      {
        key: 'article',
        label: '文章管理',
        path: '/content/article',
      },
      {
        key: 'category',
        label: '分类管理',
        path: '/content/category',
      },
      {
        key: 'tag',
        label: '标签管理',
        path: '/content/tag',
      },
    ],
  },
  {
    key: 'product',
    label: '产品管理',
    icon: null,
    path: '/product',
    children: [
      {
        key: 'product-list',
        label: '产品列表',
        path: '/product/list',
      },
      {
        key: 'product-category',
        label: '产品分类',
        path: '/product/category',
      },
    ],
  },
  {
    key: 'order',
    label: '订单管理',
    icon: null,
    path: '/order',
    children: [
      {
        key: 'order-list',
        label: '订单列表',
        path: '/order/list',
      },
      {
        key: 'order-setting',
        label: '订单设置',
        path: '/order/setting',
      },
    ],
  },
]; 